package br.unicamp.ic.inf300.arena.facade;

import java.util.Collection;
import java.util.Date;

import br.unicamp.ic.inf300.arena.modelo.logistico.Evento;
import br.unicamp.ic.inf300.arena.persistencia.dao.IEventoDAO;
import br.unicamp.ic.inf300.framework.persistencia.DAOFactory;

class EventoFacade implements IEventoFacade {

	public int atualizar(long codigo, int qtd) throws Exception {
		IEventoDAO eventoDAO = (IEventoDAO) DAOFactory.getImpl(IEventoDAO.class);
		return eventoDAO.atualizar(codigo, qtd);
	}

	public Collection<Evento> obterEventosEmCartaz(Date dataInicio,
			Date dataTermino, boolean buscarSemVaga) throws Exception {
		IEventoDAO eventoDAO = (IEventoDAO) DAOFactory.getImpl(IEventoDAO.class);
		return eventoDAO.obterEventosEmCartaz(dataInicio, dataTermino, buscarSemVaga);
	}

	public Evento obter(long codigo) throws Exception {
		IEventoDAO eventoDAO = (IEventoDAO) DAOFactory.getImpl(IEventoDAO.class);
		return eventoDAO.obter(codigo);
	}
}